﻿<!--  Copyright Microsoft Corporation -->
<!--  Author: Aravind Ramarathinam (aravr@microsoft.com) -->
 <UserControl x:Class="VmroleAuthor.Views.NewFileWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignWidth="700">
    <Grid  VerticalAlignment="Top" ShowGridLines="False">
        <Grid.RowDefinitions >
            <RowDefinition Height="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />  
            <RowDefinition Height="6" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>


        <!-- Name-->
        <Label Grid.Row="1" Grid.Column="0" >Name</Label>
        <TextBox x:Name="FileName" Grid.Row="1" Grid.Column="2" TextChanged="NameChanged"/>
        <ContentPresenter Grid.Row="2" Grid.Column="2" Content="{Binding ElementName=FileName, Path=(Validation.Errors).CurrentItem}" />

        <!-- FileLocation-->
        <Label Grid.Row="3" Grid.Column="0" >Folder</Label>
        <Grid  Grid.Row="3" Grid.Column="2" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" x:Name="FolderLocation" TextChanged="FolderChanged"></TextBox>
            <!-- Browse Button-->
            <Button Grid.Column="2" Margin="0" Padding="0" DockPanel.Dock="Right" MinWidth="50" Click="BrowseFolder">...</Button>
        </Grid>
        <ContentPresenter Grid.Row="4" Grid.Column="2" Content="{Binding ElementName=FolderLocation, Path=(Validation.Errors).CurrentItem}" />

       

        <!-- Working Dir -->
        <Expander Grid.Row="5" Grid.ColumnSpan="3" Header="Advanced (Working Directory)">
            <Grid VerticalAlignment="Top" ShowGridLines="False">
                <Grid.RowDefinitions>
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto" />                   
                    <RowDefinition Height="Auto" />                   
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="6"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Row="1" Grid.Column="0" >Working Directory</Label>
                <TextBox x:Name="WorkingDir" Grid.Row="1" Grid.Column="2" />
                <TextBlock Grid.Row="2" Grid.Column="2" MaxWidth="700" TextWrapping="Wrap"> This directory will be created which contains the json file(s) and the application payloads. If the directory with the same name already exists, its contents will be overwritten.The contents of this directory will be packaged when saved.</TextBlock>
            </Grid>
        </Expander>
       

        <!-- OK or Cancel Rows using button -->
        <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right" Grid.Row="6" Grid.Column="2" >
            <Grid>
                <Grid.RowDefinitions >
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="6" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Row="1" Grid.Column="1"  Click="OkButton_Click" >
                    <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                        <TextBlock MinWidth="50">OK</TextBlock>                       
                    </StackPanel>
                </Button>
                <Button Grid.Row="1" Grid.Column="3"  Click="CancelButton_Click">
                    <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                        <TextBlock MinWidth="50">Cancel</TextBlock>                      
                    </StackPanel>
                </Button>
            </Grid>
        </StackPanel>

    </Grid>    
</UserControl>
